package com.example.myapplication_2;

import android.app.Activity;
import android.os.Bundle;
import android.util.Log;
import android.view.View;
import android.view.Window;
import android.view.WindowManager;
import android.widget.Button;
import android.content.Intent;

import com.example.myapplication_2.a600_xm.Buy_Activity;
import com.example.myapplication_2.a600_xm.bean.Yao;
import com.example.myapplication_2.a600_xm.utils.JSONUtils;
import com.example.myapplication_2.activity.SymptomActivity;
import com.example.myapplication_2.camera.CustomCamera;
import com.example.myapplication_2.celebrity.Celebrity_main;
import com.example.myapplication_2.shop.Shop_main;


public class Main_Activity extends Activity {

    private Button btn1;
    private Button btn2;
    private Button btn3;
    private Button btn4;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        this.requestWindowFeature(Window.FEATURE_NO_TITLE);
        this.getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN,
                WindowManager.LayoutParams.FLAG_FULLSCREEN);
        setContentView(R.layout.activity_main);


        //view层的控件和业务层的控件，靠id关联和映射  给btn1赋值，即设置布局文件中的Button按钮id进行关联
        btn1 = (Button) findViewById(R.id.hellobutton);
        btn2 = (Button) findViewById(R.id.hellobutton2);
        btn3 = (Button) findViewById(R.id.hellobutton3);
        btn4 = (Button) findViewById(R.id.hellobutton4);

        //给btn1绑定监听事件 体质
        btn1.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {

                // 给bnt1添加点击响应事件
                Intent intent = new Intent(Main_Activity.this, CustomCamera.class);
                //启动
                startActivity(intent);
            }
        });
        //给btn2绑定监听事件 症状
        btn2.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {

                // 给bnt2添加点击响应事件
                Intent intent = new Intent(Main_Activity.this, SymptomActivity.class);
                //启动
                startActivity(intent);
            }
        });
        //给btn3绑定监听事件 自选
        btn3.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {

                // 给bnt3添加点击响应事件
                Intent intent = new Intent(Main_Activity.this, Buy_Activity.class);
                //启动
                startActivity(intent);
            }
        });
        //给btn4绑定监听事件 清宫
        btn4.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {

                // 给bnt4添加点击响应事件
                Intent intent = new Intent(Main_Activity.this, Celebrity_main.class);
                //启动
                startActivity(intent);
            }
        });
    }


}
